<?php
include_once '../data/database_dal.php';

class RFQDAL extends DatabaseDAL
{
    function update($id, $categoryID, $marketID, $requireQC, $process, $quantity, $measure, $annualUsage, $neededDate, $awardDate, $deliveryDate,
                    $paymentTerm, $paymentMethod, $referencePrice, $targetPrice, $showPrice, $folder, $shippingCost, $instructions,
                    $rfqIntent, $usageDetails, $industry, $requireNDA, $files, $inTime, $inUser)
    {
       
        $showPrice = true;
        $this->connect();
        $result = $this->mysqli->query("call pr_rfq_update('". $id ."', '". $categoryID ."', '". $marketID ."', '". $requireQC ."', '". $process ."', '". $quantity ."',
                                '". $measure ."', '". $annualUsage ."', '". $neededDate ."', '". $awardDate ."', '". $deliveryDate ."', '". $paymentTerm ."',
                                '". $paymentMethod ."', '". $referencePrice ."', '". $targetPrice ."', '". $showPrice ."',  '". $folder ."', '". $shippingCost ."',
                                '". $instructions ."', '". $rfqIntent ."', '". $usageDetails ."', '". $industry ."', '". $requireNDA ."', '". $files ."', '". $inTime ."', '". $inUser ."')");
        if ($this->mysqli->errno) {
            die ($this->mysqli->error);
        }
        $this->close();
        return $result;
    }

    function get($where)
    {
        $this->connect();
        $result = $this->mysqli->query("call pr_rfq_get('". $where ."')");
        $this->close();
        return $reuslt;
    }

    function getAll($orderBy)
    {
        $this->connect();
        $result = $this->mysqli->query("call pr_rfq_list('". $orderBy ."')");
        $this->close();
        return $result;
    }

    function delete($id)
    {
        $this->connect();
        $result = $this->mysqli->query("call pr_rfq_delete('". $id ."')");
        $this->close();
        return $result;
    }
}

?>
